varying float vUseStripes;

varying vec2 vUv;
varying vec3 vPosition;

void main() {
  if(vUseStripes == 1.) {
    float angle = 45.0; // 角度
    float rad = radians(angle);
    float stripeWidth = 1.0; // 条纹宽度，可调整
    float stripe = step(0.5, mod((vPosition.x * cos(rad) + vPosition.z * sin(rad)) / stripeWidth, 1.0));
    csm_DiffuseColor = vec4(vec3(stripe), 1.0);

    // csm_DiffuseColor = vec4(0.0, 0.8863, 0.0588, 1.0);
  } else {

    csm_DiffuseColor = vec4(vColor, 1.0);
  }
}
